package com.cjack.frenchexcel.model;

import com.cjack.frenchexcel.table.GoodsTable;
import com.sargeraswang.util.ExcelUtil.ExcelCell;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Created by root on 10/5/19
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ConsumerRecordModel implements Serializable {

    //excel里面的内容

    //第0列是行号，不处理
    @ExcelCell(index = 1)
    private String dateDeDepense;
    @ExcelCell(index = 2)
    private String dateDeDebit;
    @ExcelCell(index = 3)
    private String justif;
    @ExcelCell(index = 4)
    private String collaborateur;
    @ExcelCell(index = 5)
    private String carteIdentifiant;//卡号
    @ExcelCell(index = 6)
    private String description;
    @ExcelCell(index = 7)
    private String fournisseur;//合作商简名
    @ExcelCell(index = 8)
    private String nature;
    @ExcelCell(index = 9)
    private String montantEnDevise;
    @ExcelCell(index = 10)
    private String deviseOriginale;
    @ExcelCell(index = 11)
    private String montantHT;
    @ExcelCell(index = 12)
    private String tVARecup;
    @ExcelCell(index = 13)
    private String tVANonRecup;
    @ExcelCell(index = 14)
    private String montantTTC;
    @ExcelCell(index = 15)
    private String montantCharge;

    //数据库表里面的内容
    private Long id;
    private Long companyId;
    private Date createTime;
    private Date updateTime = new Date();
    //消费记录所属员工
    private Long importUserId;
    private String jobNumber;


    //发票相关
    private String invoice;//上传的发票的pdf地址
    private String invoiceImg;//上传的发票的img地址

    private String invoiceRate;//发票税率
    private String invoiceMoney;//上税总额
    private String invoiceStatus;//上传的发票的审核状态  PASS 审核通过 REJECT 审核拒绝  空为 未上传
    private Long invoiceUploadUserId;//发票上传人id
    private Date invoiceReviewTime;//发票审核时间
    private String invoiceMemo;//发票审核 备注
    private String otherId;//来源记录表的id
    private String sourceFrom;//数据来源
    private String cooperativeNumber;//供应商编号
    private String cooperativeSimpleName;//供应商简名
    private String memo;//备注
    //商品
    private GoodsTable goodsTable;
    private Long goodsId; //商品表id

    private String customHouse;//海关码  -只作为页面传参数使用，最后会保存到商品表

    public static Map<String,String> getColMap(){
        //用排序的Map且Map的键应与ExcelCell注解的index对应
        Map<String,String> map = new LinkedHashMap<>();
        map.put( "a", "Date de dépense");
        map.put( "b", "Date de débit");
        map.put( "c", "Justif.");
        map.put( "d", "Collaborateur");
        map.put( "e", "Carte Identifiant");
        map.put( "f", "Description");
        map.put( "g", "Fournisseur");
        map.put( "h", "Nature");
        map.put( "i", "Montant en devise");
        map.put( "j", "Devise originale");
        map.put( "k", "Montant HT");
        map.put( "l", "TVA récup.");
        map.put( "m", "TVA non récup.");
        map.put( "n", "Montant TTC");
        map.put( "o", "Montant charge");
        return map;
    }
}
